# Contributor: wener <wenermail@gmail.com>
# Maintainer: wener <wenermail@gmail.com>
pkgname=fio
pkgver=3.30
pkgrel=0
pkgdesc="Flexible I/O Tester"
url="https://github.com/axboe/fio"
arch="all"
license="GPL-2.0-only"
makedepends="linux-headers zlib-dev coreutils libaio-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/axboe/fio/archive/fio-$pkgver.tar.gz"
builddir="$srcdir/fio-$pkgname-$pkgver"

case "$CARCH" in
	arm*) ;; # no numactl-dev for arm
	*) makedepends="$makedepends numactl-dev" ;;
esac

build() {
	./configure \
		--prefix=/usr \
		--disable-native
	make T_TEST_PROGS=
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	mv "$pkgdir"/usr/man "$pkgdir"/usr/share

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	for i in README.rst REPORTING-BUGS MORAL-LICENSE; do
		cp -a "$builddir/$i" "$pkgdir/usr/share/doc/$pkgname"
	done
}

sha512sums="
4d8bb322497b6c5af35dda89d12415c154cda1b6169c7e8836dbc6d9ca716c1af24dd1f640810108265531112fe1045c205efb68b92f30fd6f76709780cd7bff  fio-3.30.tar.gz
"
